<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <link rel="stylesheet" href="../../css/weui.css"/>
    <link rel="stylesheet" href="../../css/login.css"/>
    <script src="../../js/jquery-2.1.1.min.js"></script>
    <script src="../../js/jquery-weui.js"></script>
    <script src="../../layer/layer.js"></script>
    <script src="../../js/main.js"></script>
    <title></title>
</head>
<body>


<div id="d" style="padding-bottom:10%;width:100%;height:0;margin-top: 1rem;background-color: black;margin-top: 0px;">
    <div style="width:70%;margin:auto auto;">
        <img src="../../img/index/top.png" style="height: auto;width:100%; margin:auto auto;"/>
    </div>
</div>


<div class="weui-panel weui-panel_access">
<div class="weui-panel weui-panel_access" >
    <div class="weui-panel__hd">成果展示</div>
    <div class="weui-panel__bd" id="data">


        <!--<a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">-->
        <!--<div class="weui-media-box__hd" style="border: 1px solid red;">-->
        <!--<img class=" weui-media-box__thumb" src="">-->
        <!--</div>-->
        <!--<div class="weui-media-box__bd">-->
        <!--<h4 class="weui-media-box__title">成果1</h4>-->
        <!--<p class="weui-media-box__desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>-->
        <!--</div>-->
        <!--</a>-->

    </div>
</div>
    <div class="weui-btn weui-btn_loading" style="color: darkslategray" id="load" onclick="loadData()">
        加载更多
    </div>
</div>
<script>
    $.ajaxSetup({
        xhrFields: {
            withCredentials: isCrossDomain
        }
    });
    var page = 1;
    var id;
    var isNext = true;

    function loadData() {
        if (isNext) {
            $.post(mainurl + "getResultList", {page: page, id: id}, function (data) {
                if (checkData(data)) {
                    isNext = data.data.hasNextPage;
                    if (!isNext) {
                        $("#load").text("");
                    }
                    page++;
                    for (var i = 0; i < data.data.list.length; i++) {
                        var d = data.data.list[i];
                        var rid = d.rid;
                        var title = d.title;
                        var content = d.content;
                        $("#data").append("<a href=\"detailedPersonal.html?id=" + rid + "\" class=\"weui-media-box weui-media-box_appmsg\">\n" +
                            "            <div class=\"weui-media-box__bd\">\n" +
                            "                <h4 class=\"weui-media-box__title\">" + title + "</h4>\n" +
                            "                <p class=\"weui-media-box__desc\">" + content + "</p>\n" +
                            "            </div>\n" +
                            "        </a>");
                    }
                }
            });
        }

    }

    $(function () {
        if($.getUrlParam('id')!=null) {
            id=$.getUrlParam('id');
            loadData();
        } else {
            errorInfo("请求非法");
        }

    });


</script>
</body>
</html>
